package com.ccit.common.client;

import com.ccit.common.fallback.GoodsClientFallback;
import com.ccit.common.feign.FeignConfiguration;
import com.ccit.common.result.Result;
import com.ccit.model.Goods;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.*;


@Repository
@FeignClient(value = "service-goods", configuration = FeignConfiguration.class, fallback = GoodsClientFallback.class)
public interface GoodsClient {

//    @PostMapping("/goods/updateGoods")
//    public Result updateGoods(@RequestBody Goods goods);

    @RequestMapping(value = "/goods/api/updateGoods", method = RequestMethod.POST)
    public Boolean updateGoods(@RequestBody Goods goods);

//    @GetMapping("/goods//getByPage/{id}")
//    public Goods getGoodsById(@PathVariable Long  id);
    @RequestMapping(value = "/goods/getById/{id}", method = RequestMethod.GET)
    public Goods getGoodsById(@PathVariable Long  id);

//    @PostMapping("/api/goods/getByName")
//    public Goods getGoodsByName(@RequestBody String  name);

    @RequestMapping(value = "/goods/api/getByName", method = RequestMethod.POST)
    public Goods getGoodsByName(@RequestBody String  name);

}
